package StrategyCode;

// EncryptContext.java - 加密上下文
public class EncryptContext {
    private EncryptStrategy strategy;

    public EncryptContext(EncryptStrategy strategy) {
        this.strategy = strategy;
    }

    public void setStrategy(EncryptStrategy strategy) {
        this.strategy = strategy;
    }

    public String encrypt(String data) {
        return strategy.encrypt(data);
    }
}
